import PureBuildForm from '../../components/unit-config-forms/build';
import { getFetchStatus } from 'actions/util';
import * as RunnableUnitAction from 'actions/runnable-unit';
import * as ReactRedux from 'react-redux';

const mapStateToProps = (state) => {
  return {
    updateFetching: getFetchStatus(state, RunnableUnitAction.updateUnitBuildConf)
  };
};
const mapDispatchToProps = (dispatch) => {
  return {
    onBuildConfUpdate: (unitId, runtimeId, conf) => {
      dispatch(RunnableUnitAction.updateUnitBuildConf(unitId, runtimeId, conf));
    }
  };
};

export default ReactRedux.connect(mapStateToProps, mapDispatchToProps)(PureBuildForm);
